library(tidyverse)

#COVID data
covid_new_cases <- read.csv("daily-new-confirmed-covid-19-cases-per-million-people.csv")

covid_new_cases <- covid_new_cases |> 
  mutate(
    date=as_date(Day)
  )

# Analyze COVID-19 case trends within the survey fieldwork period
#Figure E1
covid_trend <- covid_new_cases |> filter(
  date>="2021-11-26",date<="2021-12-15"
) |> ggplot()+
  geom_point(aes(x=date,y=daily_new_confirmed_per_million),size=3)+
  geom_line(aes(x=date,y=daily_new_confirmed_per_million))+
  geom_vline(xintercept = as_date("2021-11-30"))+
  geom_vline(xintercept = as_date("2021-12-07"),linetype=2)+
  
  geom_label(aes(x=as_date("2021-11-30"),y=860,label="First Coverage"),
             size=8)+
  geom_label(aes(x=as_date("2021-12-07"),y=860,label="Video Released"),
             size=8)+
  labs(x="Date",y="Daily New COVID \n Cases Per Million")+
  theme(panel.grid = element_blank(),
        panel.background = element_blank(),
        text = element_text(size=30),
        panel.border = element_rect(colour = "black", fill = NA, linewidth = 1.2))
covid_trend
